
package nccloud.arap.manual.aggmanualcostvo.util.rule;

import nc.bs.pubapp.AppBsContext;
import nc.impl.pubapp.pattern.rule.IRule;
import nc.vo.arap.manualcost.AggManualCostVO;
import nccloud.commons.lang.ArrayUtils;
import nccloud.commons.lang.StringUtils;

public class FillAuditInfo implements IRule<AggManualCostVO> {

  @Override
  public void process(AggManualCostVO[] vos) {
    if (ArrayUtils.isEmpty(vos)) {
      return;
    }
    for (AggManualCostVO vo : vos) {
      if (StringUtils.isEmpty(vo.getParentVO().getCreator())) {
        vo.getParentVO().setCreator(AppBsContext.getInstance().getPkUser());
      }
      if (vo.getParentVO().getCreationtime() == null) {
        vo.getParentVO().setCreationtime(
            AppBsContext.getInstance().getServerTime());
      }
    }
  }
}
